package com.iyao_app.adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.facebook.drawee.view.SimpleDraweeView;
import com.iyao_app.R;
import com.iyao_app.entry.SearchData;
import com.iyao_app.util.MarkUtil;

import java.util.List;

/**
 * 作者 :  胡家兵
 * 时间 :  2017/12/8.
 */

public class OftenAdapter extends BaseQuickAdapter<SearchData, BaseViewHolder> {


    public OftenAdapter(@Nullable List<SearchData> data) {
        super(R.layout.item_often, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, SearchData item) {
        SimpleDraweeView mSdvHead = helper.getView(R.id.sdv_head);
        TextView mTvLocation = helper.getView(R.id.tv_location);
//        helper.itemView.setLayoutParams(new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        mTvLocation.setText(item.getName());
        mSdvHead.setImageResource(MarkUtil.getId(item.getTypecode()));

    }
}
